﻿using System;
using System.Collections.Generic;
using System.Text;
using DevExpress.ExpressApp.Win;

namespace WinSCM.Win
{
    public class Splash : ISplash
    {
        static private SplashForm splashForm;

        #region ISplash Members

        public void Start()
        {
            if (splashForm == null)
            {
                splashForm = new SplashForm();
                splashForm.Show();
                System.Windows.Forms.Application.DoEvents();
            }
        }
        public void Stop()
        {
            if (splashForm != null)
            {
                splashForm.Close();
                splashForm.Dispose();
                splashForm = null;
            }
        }
        public bool IsStarted
        {
            get { return splashForm != null; }
        }
        public void SetDisplayText(string displayText)
        {
            splashForm.Text = displayText;
        }

        #endregion
    }
}
